<!DOCTYPE HTML>
<html>
    <head>
        <title>2px 偏移值 by 司徒正美</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <style>
            html{
                background:lime;
                border:0px;
            }
            body{
                background:orange;
                border:0px;
            }
            #log {
                padding:20px;
                background: red;
            }
        </style>
        <script>
            var log = function(s){
                document.getElementById("log").innerHTML = s;
                //http://bbs.51js.com/thread-84330-1-1.html http://www.360doc.com/content/08/0312/19/24120_1113143.shtml

            }
            document.onclick = function(e){
                e = e || event;
                log(document.documentElement.clientTop+"  "  +document.body.clientTop)
            }
        </script>
    </head>
    <body>

        <pre id="log">

        </pre>
    </body>
</html>
